# coding=UTF-8

import os
import sys
import csv
import requests
from datetime import datetime
from bs4 import BeautifulSoup
import json
from requests.packages import urllib3
urllib3.disable_warnings()

def get():
    print(f'start...')
    url = f"https://qun.qq.com/cgi-bin/group_digest/digest_list?bkn=612425738&bkn=612425738&group_code=950881907&page_start=0&page_limit=5"
    r = requests.get(
        url,
        headers={
            'Host': 'qun.qq.com',
            'Connection': 'keep-alive',
            'Accept': 'application/json, text/plain, */*',
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) QQ/3.3.0.22020 TIM2.0/3.3.0.22020 Chrome/43.0.2357.134 Safari/537.36 QBCore/3.43.1298.400 QQBrowser/9.0.2524.400',
            'Accept-Encoding': 'gzip, deflate',
            'Accept-Language': 'en-US,en;q=0.8',
            'Cookie': 'RK=BVDYDzxPZ; pgv_pvid=493239861; ptcz=dc064f10d53505f3f30aa610be6dbb3a3d6fc9a01d741b23eeac1a2ec74ef5; p_skey=g*2JdaNXh0Ze6ZTzc8CzjXbLhGUImdqQ19Kbr5CzIo_; p_uin=o41476872; uin=o41476872; skey=Zq1SPWes',
        },
        verify=False
    )
    resJson = json.loads(r.text)
    msg_list = resJson['data']['msg_list']
    print(msg_list[0])




if __name__ == '__main__':
    get()
